package com.hlk.feign.fallback;

import com.hlk.feign.ArticleFeignClient;
import com.hlk.result.Result;
import feign.hystrix.FallbackFactory;

/**
 * @author hlk
 * @version 1.0
 * @date 2021-01-18 14:19
 */
public class ArticleFeignClientFallbackFactory implements FallbackFactory<ArticleFeignClient> {
    @Override
    public ArticleFeignClient create(Throwable throwable) {
        return new ArticleFeignClient() {
            @Override
            public Result detail(String articleId) {
                return Result.error();
            }
        };
    }
}
